// 全局过滤器
// 时分秒
export function Hms(date) {
    let time = new Date(date)

    let Y = time.getFullYear()
    let M = time.getMonth() + 1
    let D = time.getDate()

    let H = time.getHours()
    let m = time.getMinutes()
    let s = time.getSeconds();

    let Hms = [H, m, s].map(v => String(v).padStart(2, '0')).join('/')
    return Hms
}
// 年月日
export function YMD(date) {
    let time = new Date(date)

    let Y = time.getFullYear()
    let M = time.getMonth() + 1
    let D = time.getDate()

    let H = time.getHours()
    let m = time.getMinutes()
    let s = time.getSeconds();

    let YMD = [Y, M, D].map(v => String(v).padStart(2, '0')).join('/')
    return YMD
}
// 年月日，时分秒
export function YMDHms(date) {
    let time = new Date(date)

    let Y = time.getFullYear()
    let M = time.getMonth() + 1
    let D = time.getDate()

    let H = time.getHours()
    let m = time.getMinutes()
    let s = time.getSeconds();

    let YMD = [Y, M, D].map(v => String(v).padStart(2, '0')).join('/')
    let Hms = [H, m, s].map(v => String(v).padStart(2, '0')).join(':')
    let YMDHms = YMD + '    ' + Hms
    return YMDHms
}

